Skip to content

Remove usage of float keys in arrays tests #6662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Feb 3, 2021

Also make test output not produce trailling whitespaces

This is in preparation for #6661 as this would just distract from the other PR, and these tests are rather useless.

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine apart from the indicated tests.

@@ -2,7 +2,7 @@
basic array_fill test
--FILE--
<?php
$array1 = array(0.0, 1, 2.5);
$array1 = array(0, 1, 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep this one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored it

@@ -1,51 +0,0 @@
--TEST--
Test array_key_exists() function : usage variations - floats and casting to ints
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is important to keep -- array_key_exists behavior with floats.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored it

@@ -46,13 +46,9 @@ $arrays = array (
array("1" => 1),
array("one" => 1, 'two' => 2, "three" => 3, 4 => 4),

// arrays with float values
/*5*/ array("float" => 2.3333),
array("f1" => 1.2, 'f2' => 3.33, 3 => 4.89999922839999, 'f4' => 33333333.333333),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly important, but these two look unrelated? Those are float values only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, don't know why I went and removed those

Also make test output not produce trailling whitespaces
@Girgias Girgias force-pushed the remove-float-keys-array-test branch from 77140b0 to fbc495d Compare February 9, 2021 02:44
@php-pulls php-pulls closed this in 3fbd3d2 Feb 9, 2021
@Girgias Girgias deleted the remove-float-keys-array-test branch February 9, 2021 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants